package com.foreknow.view;

import com.foreknow.bean.Admin;
import com.foreknow.service.AdminService;
import com.foreknow.service.impl.AdminServiceImpl;

import java.util.Scanner;

public class AdminViewImpl implements AdminView {
    private Scanner input = new Scanner(System.in);

    @Override
    public Admin login() {
        System.out.println("please input adminName:");
        String adminName = input.next();
        System.out.println("please input password:");
        String password = input.next();
        AdminService service = new AdminServiceImpl();
        return service.isValidate(adminName,password);
    }

    public static void main(String[] args) {
        AdminView view = new AdminViewImpl();
        Admin admin = view.login();
        System.out.println(admin.getAdminName());
    }
}
